<?php

declare(strict_types=1);

namespace App\CustHub\Model;

use Mine\MineModel;

/**
 * @property int $id 
 * @property int $uid 
 * @property int $main_uid 
 * @property int $type 任务类型：0=打智能标签 1=移动智能标签
 * @property int $status 状态：0=等待中 1=进行中 2=已完成 3=已取消
 * @property int $begin_time 
 * @property int $end_time 
 * @property int $contact_count 客户数量
 * @property int $tag_count 标签数量
 * @property int $finished_contact_count 已完成客户数量
 * @property int $finished_tag_count 已完成标签数量
 * @property array $content 任务内容
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 */
class ChContactTaskCenter extends MineModel
{
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'ch_contact_task_center';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'uid', 'main_uid', 'type', 'status', 'begin_time', 'end_time', 'contact_count', 'tag_count', 'finished_contact_count', 'finished_tag_count', 'content', 'created_at', 'updated_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'uid' => 'integer', 'main_uid' => 'integer', 'type' => 'integer', 'status' => 'integer', 'begin_time' => 'integer', 'end_time' => 'integer', 'contact_count' => 'integer', 'tag_count' => 'integer', 'finished_contact_count' => 'integer', 'finished_tag_count' => 'integer', 'content' => 'array', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    public function user()
    {
        return $this->belongsTo(ChUser::class, 'uid', 'id');
    }
}
